<%@ page import="News.service.UserServer" %>
<%@ page import="javax.swing.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/12/20 0020
  Time: 8:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录控制</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    String username=(String)request.getParameter("username");
    String password=(String)request.getParameter("password");
    UserServer us=new UserServer();
    int i=us.selectUser(username,password);
    if(i>0){
        request.getRequestDispatcher("/App/Index.jsp").forward(request,response);
    }else{
        JOptionPane.showMessageDialog(null,"用户名或密码输入错误");
        response.sendRedirect("/App/Login.jsp");
    }

%>
</body>
</html>
